#!/bin/bash
#
# Pulley sample subscription payload file, example based on a Slackware64
# system
#

# Agents that should be run. Enabling the agent also loads its agent-specific
# directives for use in the payload file.
enable_agent hostname
enable_agent package
enable_agent rsync
enable_agent script
enable_agent virtualbox


# Probes that should be enabled
enable_probe virtualization


# It's a good idea to put non-core directives inside tests. This way, an
# agent or section can be easily disabled if necessary.

if agent_enabled hostname; then
	set_context agent/hostname/hostname "darkstar.localdomain"
fi

if agent_enabled package; then
	add_repository --name main \
		--url "http://mirrors.kernel.org/slackware/slackware64-current/slackware64" \
		--pubkey "http://mirrors.kernel.org/slackware/slackware64-current/GPG-KEY"
	#
	
	# Packages
	add_package --from main a/aaa_elflibs-14.0-x86_64-4
fi

if agent_enabled rsync; then
	set_context agent/rsync/url "rsync://sample-server/resource"
fi

if agent_enabled script; then
	function myscript() {
		echo "Hello, World!"
	}
	
	enable_script myscript
fi

if agent_enabled virtualbox; then
	set_context agent/virtualbox/kernel "true"
fi
